<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录</title>
    <link rel="stylesheet" href="./button.css">
    <style>
        body {
            background-image: url(../login_picture/background.jpg);
        }

        * {
            margin: 0;
            height: 0;
            box-sizing: border-box;
        }

        .log_tips {
            width: 100%;
            height: 100px;
            background-color: rgb(45, 98, 98);
        }

        .login_wrap {
            width: 100%;
            height: 500px;
            margin-top: 120px;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .link {
            width: 100%;
            height: 100px;

        }

        #login {
            width: 400px;
            height: 300px;
            background-color: rgb(38, 93, 125);
            opacity: 0.7;
            border-radius: 10px;

        }

        form {
            width: 100%;
            height: 250px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: space-evenly;
            /* background-color: black; */
        }

        form>input {
            padding: 9px 10px;
            width: 300px;
            height: 34px;
            border-radius: 5px;
            opacity: 0.5;
        }

        form>button {
            width: 200px;
            height: 38px;
            border-radius: 50px;
            /* background-color: coral; */
            background: linear-gradient(280deg, rgb(240, 11, 11), rgb(247, 14, 14));
            color: #fff;
            outline: none;
        }

        .login_tishi {
            width: 180px;
            height: 40px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            /* color: rgb(153, 153, 153); */

        }

        form .login_tishi>span {
            display: block;
            height: 30px;
            width: 80px;
            text-align: center;
            display: flex;
            align-items: center;
            cursor: pointer;
        }

        /*  form .login_input{
            display: flex;
            flex-direction: ;
        } */
        .login_tishi_fSzie {
            font-size: 20px;
            color: black;
            font-weight: 700;
            /* font-size: 24px; */
            background: linear-gradient(to right, rgb(160, 117, 82) 12%, rgb(226, 42, 6) 80%);
            background-position: left bottom;
            background-repeat: no-repeat;
            background-size: 100% 6px;
        }

        .login_links {

            text-align: center;
        }

        .login_links a {
            text-decoration: none;
            color: #fff;
            display: inline-block;
            width: 80px;
            height: 30px;

        }

        .login_input2 {
            display: none;
        }      
      
    </style>
</head>

<body>
    <!-- <div class="log_tips"></div> -->
    <div class="login_wrap">
        <div id="login">
            <form action="">
                <div class="login_tishi"><span class="login_tishi_fSzie">密码登录</span><span>短信登录</span></div>
                <input type="text" placeholder="请输入账号" class="login_input1">
                <input type="password" placeholder="请输入密码" class="login_input1">
                <input type="text" placeholder="请输入手机号码" class="login_input2">
                <input type="text" placeholder="请输入验证码" class="login_input2">
                <a href="javascript:;" class="aki-btn">
                    <span>登&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;录</span>
                </a>
            </form>
            <div class="login_links">
                <a href="./forget.html" target="_blank">忘记密码</a>
                <a href="" target="_blank">忘记账号</a>
                <a href="register.html" target="_blank">免费注册</a>
            </div>
        </div>
    </div>
    <div class="link"></div>
</body>
<script>
    let login_tishis = document.querySelectorAll('.login_tishi span')
    let login_wrap = document.querySelector('.login_wrap')
    /* for (let i = 0; i < login_tishis.length; i++) {
        login_tishis[i].addEventListener('click', function () {
            document.querySelector('.login_tishi .login_tishi_fSzie')
                .classList.remove('login_tishi_fSzie')
            this.classList.add('login_tishi_fSzie')

        })
    } */
    let inptLoginPass = document.querySelectorAll('input.login_input1')
    let inptLogPhone = document.querySelectorAll('input.login_input2')
    /* inptLoginPass[1].addEventListener('focus',function(event){
        event.target.type="text"
    }) */
    login_tishis[0].addEventListener('click', function () {
        document.querySelector('.login_tishi .login_tishi_fSzie')
            .classList.remove('login_tishi_fSzie')
        this.classList.add('login_tishi_fSzie')
        for (let i = 0; i < inptLoginPass.length; i++) {
            inptLogPhone[i].style.display = "none"
            inptLoginPass[i].style.display = "block"

        }
    })
    login_tishis[1].addEventListener('click', function () {
        document.querySelector('.login_tishi .login_tishi_fSzie')
            .classList.remove('login_tishi_fSzie')
        this.classList.add('login_tishi_fSzie')
        for (let i = 0; i < inptLogPhone.length; i++) {
            inptLoginPass[i].style.display = "none"
            inptLogPhone[i].style.display = "block"
        }
    })
</script>

</html>